import { defineComponent } from "vue";
export default defineComponent({
	props: {
		profile: {
			type: Object,
			default() {
				return {};
			}
		},
		schema: {
			type: Object,
			default() {
				return {};
			}
		}
	},
	emits: [],
	setup(props) {
		const preview = ref<string>("profile");
		return () => {
			return (
				<div class="relative p-4">
					<el-radio-group v-model={preview.value} class="ml-4">
						<el-radio label="profile" size="large">
							profile
						</el-radio>
						<el-radio label="schema" size="large">
							schema
						</el-radio>
					</el-radio-group>
					<span
						class="absolute iconfont iconbx-copy-alt cursor-pointer"
						style="right: 30px;top: 82px;"
						v-copy={JSON.stringify(preview.value === "profile" ? props.profile : props.schema, null, 2)}
					></span>
					<pre class="bg-gray-100 p-4 leading-5" style="max-height: 60vh;overflow: auto;margin-bottom:0">
						{JSON.stringify(preview.value === "profile" ? props.profile : props.schema, null, 2)}
					</pre>
				</div>
			);
		};
	}
});
